(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "Cycle")
(use "Game")
(use "PV")
(use "Obj")
(script 36)


(local
    newAct
    local1
    newProp
    newProp_2
    newProp_3
    newProp_4
    newProp_5
    newProp_6

)
(instance public {Room 36} of Rm
    (properties
        picture 36
    )

    (method (init)
        = north 33
        = south 39
        = east 37
        = horizon 75
        = global101 0
        (super:init())
        (self:setRegions(505))
        Load(rsVIEW 345)
        Load(rsVIEW 21)
        Load(rsVIEW 2)
        = newProp (Prop:new())
        = newProp_2 (Prop:new())
        = newProp_3 (Prop:new())
        = newProp_4 (Prop:new())
        = newProp_5 (Prop:new())
        = newProp_6 (Prop:new())
        (send newProp:
            isExtra()
            view(650)
            loop(5)
            cel(0)
            posn(156 119)
            setPri(8)
            setCycle(Fwd)
            ignoreActors()
            init()
        )
        (send newProp_2:
            isExtra()
            view(650)
            loop(6)
            cel(3)
            posn(218 131)
            setPri(9)
            setCycle(Fwd)
            ignoreActors()
            init()
        )
        (send newProp_3:
            isExtra()
            view(663)
            loop(0)
            cel(1)
            posn(114 69)
            setPri(3)
            setCycle(Fwd)
            cycleSpeed(2)
            ignoreActors()
            cycleSpeed(2)
            init()
        )
        (send newProp_4:
            isExtra()
            view(663)
            loop(1)
            cel(1)
            posn(23 82)
            setPri(4)
            setCycle(Fwd)
            cycleSpeed(2)
            ignoreActors()
            cycleSpeed(2)
            init()
        )
        (send newProp_5:
            isExtra()
            view(663)
            loop(2)
            cel(3)
            posn(12 94)
            setPri(5)
            setCycle(Fwd)
            cycleSpeed(2)
            ignoreActors()
            cycleSpeed(2)
            init()
        )
        (send newProp_6:
            view(341)
            loop(4)
            cel(2)
            posn(84 31)
            setPri(0)
            setCycle(Fwd)
            cycleSpeed(1)
            ignoreActors()
            init()
        )
        (send gEgo:
            view(2)
            xStep(2)
            yStep(1)
            init()
        )
        (self:setScript({Ego drinking water}))
        (if (global100)
            = picture 136
        )
        (if (== gPicture 33)
            (send gEgo:posn(105 77))
        )(else
            (if (== gPicture 39)
                (send gEgo:
                    x(165)
                    y(187)
                )
            )
        )
        = newAct (Act:new())
        (send newAct:
            posn(188 120)
            view(345)
            setCycle(Walk)
            moveSpeed(2)
            setMotion(Wander)
            illegalBits(32769)
            xStep(1)
            yStep(1)
            init()
        )
    )


    (method (handleEvent pEvent)
        (var gInvSaidMe)
        (if (== (send pEvent:type()) 128)
            (if (Said('deliver>'))
                (if (= gInvSaidMe (send gInv:saidMe()))
                    (if ((send gEgo:has((send gInv:indexOf((= gInvSaidMe (send gInv:saidMe())))))))
                        Print(36 0)
                    )(else
                        proc0_19()
                    )
                )
            )(else
                (if ((Said('enter,capture/fish') or Said('fish[/!*]')) or Said('cast/pole'))
                    Print(36 1)
                )(else
                    (if (Said('look>'))
                        (if (Said('<in/lake,water'))
                            Print(36 2)
                        )(else
                            (if (Said('<under/bridge'))
                                Print(36 3)
                            )(else
                                (if (Said('/beach'))
                                    Print(36 4)
                                )(else
                                    (if (Said('/bush'))
                                        Print(36 5)
                                    )(else
                                        (if (Said('/dirt'))
                                            Print(36 6)
                                        )(else
                                            (if (Said('/grass'))
                                                Print(36 7)
                                            )(else
                                                (if (Said('/flora'))
                                                    Print(36 8)
                                                )(else
                                                    (if (Said('/blossom'))
                                                        Print(36 9)
                                                    )(else
                                                        (if (Said('/forest'))
                                                            Print(36 10)
                                                        )(else
                                                            (if (Said('/garden'))
                                                                Print(36 11)
                                                            )(else
                                                                (if (Said('/lake,water'))
                                                                    Print(36 12)
                                                                )(else
                                                                    (if (Said('/bridge'))
                                                                        Print(36 13)
                                                                    )(else
                                                                        (if (Said('/path'))
                                                                            Print(36 14)
                                                                        )(else
                                                                            (if (Said('/bench'))
                                                                                Print(36 15)
                                                                            )(else
                                                                                (if (Said('/castle'))
                                                                                    Print(36 16)
                                                                                )(else
                                                                                    (if (Said('/ocean'))
                                                                                        Print(36 17)
                                                                                    )(else
                                                                                        (if (Said('/swan'))
                                                                                            Print(36 18)
                                                                                        )(else
                                                                                            (if (Said('/parrot,bird,cockatoo'))
                                                                                                Print(36 19)
                                                                                            )(else
                                                                                                (if (Said('[<around][/room,island]'))
                                                                                                    Print(36 20)
                                                                                                )
                                                                                            )
                                                                                        )
                                                                                    )
                                                                                )
                                                                            )
                                                                        )
                                                                    )
                                                                )
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )(else
                        (if (Said('get,capture/bird,parrot,cockatoo'))
                            Print(36 0)
                        )(else
                            (if (Said('converse/bird,parrot,cockatoo'))
                                Print(36 21)
                            )(else
                                (if (Said('get/blossom'))
                                    Print(36 22)
                                )(else
                                    (if (Said('wade,bathe,dive'))
                                        Print(36 23)
                                    )(else
                                        (if (Said('get/water'))
                                            Print(36 24)
                                        )(else
                                            (if (Said('drink') or Said('get/drink'))
                                                (if (& (= local1 proc0_2(gEgo 15)) $0002)
                                                    (Ego drinking water:changeState(1))
                                                )(else
                                                    Print(800 1)
                                                )
                                            )(else
                                                (if (Said('sit'))
                                                    Print(36 25)
                                                )(else
                                                    (if (Said('converse/swan'))
                                                        Print(36 26)
                                                    )(else
                                                        (if (Said('converse/parrot,bird,cockatoo'))
                                                            Print(36 27)
                                                        )(else
                                                            (if (Said('get,capture/swan'))
                                                                Print(36 28)
                                                            )(else
                                                                (if (Said('kiss'))
                                                                    Print(36 29)
                                                                )
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance {Ego drinking water} of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 1
                (proc0_10() (send gEgo:
                    setMotion(0)
                    view(21)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 2
                (= global120 Print(36 30 134 -1 20 172) (Timer:setReal(self 5))  )
            )
            (case 3
                ((send gEgo:setCycle(Beg self))  )
            )
            (case 4
                ((send gEgo:
                    view(2)
                    setCycle(Walk)
                )
 proc0_23() proc0_11() )
            )
        )
    )

)
